package com.jy.adscm.zltx.mapper.mysql;

import com.jy.adscm.zltx.bean.JyDrawingList;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 图纸清单表 Mapper 接口
 * </p>
 *
 * @author zyl
 * @since 2018-10-26
 */
public interface JyDrawingListMapper extends BaseMapper<JyDrawingList> {


    @Select("SELECT NAME FROM jy_drawing_type WHERE ID = #{id}")
    String  selectDrawingTypeName(Integer id);

    @Select("SELECT id,drawing_name drawingName,parent_id parentId FROM jy_drawing_list  WHERE parent_id = #{parent_id}")
    List<JyDrawingList> selectByParentId(Long parent_id);
    @Select("SELECT id,drawing_name drawingName,parent_id parentId,drawing_type drawingType,drawing_code drawingCode ,rank FROM jy_drawing_list  WHERE parent_id = #{parent_id}  order  by rank desc ")
    List<JyDrawingList> selectByParentId2(Long parent_id);

    void updateJyDrawingList(JyDrawingList jyDrawingList);
}
